<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnIsRepairRestrictedIsCompressRequiredInStepProjectTable extends AbstractMigration
{
    public function up()
    {
        $this->table('step_project')
            ->addColumn('is_repair_restricted', 'enum', [
                'null' => false,
                'values' => 'yes,no',
                'default' => 'yes',
                'comment' => '任务发布后组内返修是否受限',
            ])
            ->addColumn('is_compress_required', 'enum', [
                'null' => false,
                'values' => 'yes,no',
                'default' => 'yes',
                'comment' => '外包文件是否需要压缩/解压',
            ])
            ->save();
    }

    public function down()
    {
        $this->table('step_project')
            ->removeColumn('is_repair_restricted')
            ->removeColumn('is_compress_required')
            ->save();
    }
}
